home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / EDUCMISC / IQBUILD.LZH / NUMBERS.BAS < prev    next >
BASIC Source File  |  1987-01-12  |  5KB  |  73 lines

  1. 5 DEFINT A-Z:KEY(10) ON:ON KEY(10) GOSUB 500:KEY(9) ON:ON KEY(9) GOSUB 600
  2. 10 CLS:LOCATE 1,34:COLOR 0,15:PRINT" IQ Builder ":COLOR 15,0
  3. 20 LOCATE 2,32:PRINT"Number Series 1":COLOR 7,0
  4. 30 LOCATE 4,5:PRINT"A number series is a list of numbers that are connected to each other by"
  5. 40 LOCATE 5,1:PRINT"a rule.  For example, look at this simple number series:"
  6. 50 GOSUB 3000:GOSUB 3100:GOSUB 4000
  7. 60 GOSUB 6500:PRINT TAB(10) "(";:COLOR 15:PRINT"1";:COLOR 7:PRINT")  add 3 to each number to get the next."
  8. 70 PRINT TAB(10) "(";:COLOR 15:PRINT"2";:COLOR 7:PRINT")  add 2 to each number to get the next.":N=2:GOSUB 6000
  9. 80 IF Z>0 THEN LOCATE 11,1:GOTO 60
  10. 90 GOSUB 7000:PRINT"Rules for number series can involve addition, subtraction, multiplication,
  11. 100 PRINT"and division.":PRINT
  12. 110 PRINT"The rule tells you how to change each number in the series into the next number"
  13. 120 PRINT"in the series.":PRINT
  14. 130 GOSUB 4000:GOSUB 3000
  15. 140 GOSUB 6500:GOSUB 3100:PRINT TAB(10) "(";:COLOR 15:PRINT"1";:COLOR 7:PRINT") add 2   (";:COLOR 15:PRINT"2";:COLOR 7:PRINT") subtract 2   (";:COLOR 15:PRINT"3";:COLOR 7:PRINT") multiply by 2"
  16. 150 N=3:GOSUB 6000:IF Z>0 THEN 150
  17. 160 GOSUB 7000:PRINT"In a number series, the numbers can change by following more than one rule."
  18. 170 GOSUB 2000:GOSUB 3100
  19. 180 PRINT"Here you add 1, then add 3, then add 1 again, etc.:"
  20. 190 PRINT TAB(10) "2 (+1) 3 (+3) 6 (+1) 7 ...":GOSUB 4000
  21. 200 GOSUB 3100:GOSUB 5000
  22. 205 IF Z>0 THEN 200
  23. 210 GOSUB 7000:PRINT"There's one more thing you should know before you try solving some number"
  24. 220 PRINT"series.";:GOSUB 4000
  25. 230 PRINT"Sometimes a number series actually contains more than one series."
  26. 240 PRINT:PRINT"Here's one series:  1  3  5  7"
  27. 250 PRINT:PRINT"Here's another:  21  19  17  15"
  28. 260 PRINT:PRINT"Here's one series that combines them both:"
  29. 270 GOSUB 3000:GOSUB 3100:GOSUB 4000
  30. 280 PRINT"We call a series that combines two or more series an `alternating series'"
  31. 290 PRINT"because it alternates back and forth between the two series."
  32. 300 GOSUB 4000:GOSUB 7000
  33. 310 PRINT"The way to solve an alternating series is to find the rule for each series and"
  34. 320 PRINT"solve one series at a time.  Then put the answers together.":GOSUB 3100:GOSUB 5000
  35. 330 IF Z>0 THEN 310
  36. 340 GOSUB 7000:PRINT"Remember, the numbers can change by one or more rules.  You can also have an"
  37. 350 PRINT"alternating series with two or more series combined into one series.":PRINT
  38. 370 GOSUB 4000:GOTO 600
  39. 500 RUN "iqbuild"
  40. 600 RUN "num2"
  41. 2000 PRINT:PRINT"Look at this number series."
  42. 3000 READ A,B,C,D,E,F,G,H,I,J:RETURN
  43. 3100 PRINT:PRINT TAB(10) "╔" STRING$(35,"═") "╗"
  44. 3110 PRINT TAB(10) "║";:COLOR 15:PRINT A B C D E F G H;:COLOR 7:PRINT TAB(46) "║"
  45. 3120 PRINT TAB(10) "╚" STRING$(35,"═") "╝":PRINT:RETURN
  46. 4000 Y1=CSRLIN:X1=POS(0)
  47. 4010 LOCATE 24,1:PRINT"Press any key to continue";:BEEP:GOSUB 59990:LOCATE 24,1:PRINT SPC(79);
  48. 4020 LOCATE Y1,X1:RETURN
  49. 5000 PRINT"Type in the next two (2) numbers in this series."
  50. 5010 BEEP:INPUT "Put a comma between them - ",X,Y
  51. 5015 Y1=CSRLIN:X1=POS(0)
  52. 5020 IF (X=I)*(Y=J) THEN 6100
  53. 5030 Z=Z+1:IF Z=3 THEN LOCATE 24,1:PRINT SPC(79);:PLAY "n50n25":LOCATE 24,1:PRINT"The answer is:  " I "," J;:Z=0:TIMEOUT=3:GOSUB 59950:LOCATE 24,1:PRINT SPC(79);:LOCATE Y1,X1:RETURN
  54. 5040 LOCATE 24,1:PRINT SPC(79);:PLAY "mbn50n25":LOCATE 24,1:PRINT"No!  Try again.";:TIMEOUT=3:GOSUB 59950:LOCATE 24,1:PRINT SPC(79);:LOCATE Y1-2,X1:GOTO 5000
  55. 5500 DATA 2,4,6,8,10,12,14,16,18,20
  56. 5510 DATA 1,2,4,8,16,32,64,128,0,0
  57. 5520 DATA 2,3,6,7,10,11,14,15,18,19
  58. 5530 DATA 10,12,11,13,12,14,13,15,14,16
  59. 5540 DATA 1,21,3,19,5,17,7,15,9,13
  60. 6000 Y1=CSRLIN:X1=POS(0):Z=0
  61. 6010 LOCATE 24,1:PRINT "Enter the number of your answer";
  62. 6020 BEEP:GOSUB 59990:IF INSTR("123456789",IKEY$)=0 THEN 6020
  63. 6030 IF VAL(IKEY$)=N THEN 6100
  64. 6040 Z=Z+1:IF Z=3 THEN LOCATE 24,1:PRINT SPC(79);:PLAY "n50n25":LOCATE 24,1:PRINT"The answer is" N;:Z=0:TIMEOUT=3:GOSUB 59950:LOCATE 24,1:PRINT SPC(79);:LOCATE Y1,X1:RETURN
  65. 6050 LOCATE 24,1:PRINT SPC(79);:PLAY "mbn50n25":LOCATE 24,1:PRINT"No!  Try again.";:TIMEOUT=3:GOSUB 59950:LOCATE 24,1:PRINT SPC(79);:GOTO 6010
  66. 6100 LOCATE 24,1:PRINT SPC(79);:PLAY "mbc16c16c16ge8g":LOCATE 24,1:PRINT"Right!";:TIMEOUT=3:GOSUB 59950:LOCATE 24,1:PRINT SPC(79);:LOCATE Y1,X1:Z=0:RETURN
  67. 6500 PRINT"What's the rule for this series?":RETURN
  68. 7000 FOR Y=4 TO 24:LOCATE Y,1:PRINT SPC(79);:NEXT Y:LOCATE 4,1:RETURN
  69. 59950 TIMEOUT$=TIME$:TIME2=VAL(LEFT$(TIMEOUT$,2))*120+VAL(MID$(TIMEOUT$,4,2))*60+VAL(RIGHT$(TIMEOUT$,2))
  70. 59960 TIMEOUT$=TIME$:TIME3=VAL(LEFT$(TIMEOUT$,2))*120+VAL(MID$(TIMEOUT$,4,2))*60+VAL(RIGHT$(TIMEOUT$,2))
  71. 59970 IF TIMEOUT > TIME3 - TIME2 THEN 59960 ELSE RETURN
  72. 59990 IKEY$=INKEY$:IF IKEY$="" THEN 59990 ELSE RETURN
  73.